<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<input type="hidden" name="zh_parsen/fzr_name" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name"/>"/>
<input type="hidden" name="zh_parsen/fzr_mobile" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile"/>"/>
<input type="hidden" name="zh_parsen/fzr_tel" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/>"/>
<input type="hidden" name="zh_parsen/fzr_email" value="<x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/>"/>
<div class="t_bar"><span class="color_red">*</span>${param.title }</div>
	<table class="t_css" id="eq_table0" width="100%" border="0" cellpadding="0" cellspacing="1">
		<col width="20%"/>
		<col width="30%"/>
		<col width="20%"/>
		<col width="30%"/>
	
	    <tr >
	        <td align="right">基地名称：</td>
	        <td colspan="3">
	        	<input type='text' name='proposal/zh_title' id='zh_title' style="width: 88%" class="input_css required" maxlength="100" value='<x:out select="$xmlData/data/proposal/zh_title"/>' label="基地名称">
	        </td>
	    </tr>
        <tr>
            <td align="right">项目类别：</td>
            <td colspan="3">
                <span name="proposal/sub_grant_name">
                    <x:out select="$xmlData/data/proposal/sub_grant_name" />
                </span>
            </td>
        </tr>
        <tr>
            <td align="right">申请单位：</td>
            <td colspan="3">
                <span name="organizations/organization/org_name">
                    <x:out select="$xmlData/data/organizations/organization[@submit_org=1]/org_name"/>
                </span>
            </td>
        </tr>
        <tr>
            <td align="right">单位地址：</td>
            <td colspan="3">
                <span name="organizations/organization/address">
				    <x:out select="$xmlData/data/organizations/organization[@submit_org='1']/address" />
		        </span>
            </td>
        </tr>
	    <tr >
	        <td align="right">归口管理单位：</td>
	        <td colspan="1">
	        	<c:set var="recomend_org">{'id':'<x:out select="$xmlData/data/proposal/recomend_org_value" />','name':'<x:out select="$xmlData/data/proposal/recomend_org_name" />'}</c:set>
				<cpt:tree key="recommended_org" cacheable="false" className="hn_iuput_kuang " readonly="true" value="${recomend_org}"  label="归口管理单位"
         			id="recomend_org" onlyChooseLeaf="false"  showPattern="all" shieldPattern="0" topCheckbox="true" onClick="initTreeValueExt" />
				<input type="hidden" id="recomend_org_value" name="proposal/recomend_org_value"  class="required"  value="<x:out select="$xmlData/data/proposal/recomend_org_value" />" label="归口管理单位">
				<input type="hidden" name="proposal/recomend_org_name" value="<x:out select="$xmlData/data/proposal/recomend_org_name" />">
				
 			</td>
 			<td  align="right" nowrap>主管处室：</td>
			 <td  colspan="1">
				<span name="proposal/default_admin_org_name"><x:out select="$xmlData/data/proposal/default_admin_org_name" /></span>
			</td>
	    </tr>
	    <tr>
	       <td align="right">批准时间：</td>
	       <td>
	           <c:set var="ratify_time"><x:out select="$xmlData/data/proposal/ratify_time" /></c:set>
               <cpt:date id="ratify_time" name="proposal/ratify_time" value="${ratify_time}" className="required date" label="批准时间"></cpt:date> 
	       </td>
	       <td align="right">验收时间：</td>
           <td>
               <c:set var="reception_time"><x:out select="$xmlData/data/proposal/reception_time" /></c:set>
               <cpt:date id="reception_time" name="proposal/reception_time" value="${reception_time}" className="required date" label="验收时间"></cpt:date>
           </td>
	    </tr>
	    <tr >
            <td align="right">负责人姓名：</td>
            <td>
                <span name="proposal/fzr_name"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/basic_info/zh_name" /></span>
            </td>
            <td align="right">负责人手机：</td>
            <td>
                <span name="proposal/fzr_mobile"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/mobile" /></span>
            </td>
        </tr>
        <tr >
            <td align="right">联系电话：</td>
            <td>
                <span name="proposal/fzr_tel"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/tel_work"/></span>
            </td>
            <td align="right">电子邮箱：</td>
            <td>
                <span name="proposal/fzr_email"><x:out select="$xmlData/data/zh_persons/zh_person[@submit_psn='1']/contact/email"/></span>
            </td>
        </tr>
	     <tr >
            <td align="right">联系人姓名：</td>
            <td>
                <input  type="text" label="联系人姓名" name="proposal/contact_psn_cname" class="input_css required" maxlength="50" value="<x:out select="$xmlData/data/proposal/contact_psn_cname" />">
            </td>
            <td align="right">联系人手机：</td>
            <td>
                <input type="text" label="联系人手机" name="proposal/contact_psn_mobile" class="input_css required mobile" onfocus="InitInput.setNumber(this,11,0,0)" value="<x:out select="$xmlData/data/proposal/contact_psn_mobile" />">
            </td>
        </tr>
        <tr>
            <td align="right">建设运行投入（万元）：</td>
            <td>
                <input type='text' name='proposal/construction_amt' class="input_css required" id='construction_amt' onfocus="InitInput.setNumber(this,9,2,2)" style="text-align: right;" value='<x:out select="$xmlData/data/proposal/construction_amt"/>' label="建设运行投入">
            </td>
            <td align="right">申报日期：</td>
            <td>
                <c:set var="submit_date"><x:out select="$xmlData/data/proposal/submit_date" /></c:set>
                <cpt:date id="apply_date_curr" name="proposal/submit_date" value="${submit_date}" className="required date" label="申报日期"></cpt:date>
            </td>
        </tr>
</table>
<div class="t_bar"><span class="color_red">*</span>申请基地类型的特点及优势（限200字）</div>
<table id="tblMileStones2" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal2" style="width:98%; outline:none;resize:none;" class="input_textarea required  maxlength:200" label="申请基地类型的特点及优势"   rows=5 cols=60><x:out select="$xmlData/data/project/goal2" /></textarea>
            <input type="hidden" name="project/goal2_hidden" id="project/goal2_hidden" value="<x:out select="$xmlData/data/project/goal2_hidden" />"/>
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>承担的国家或安徽省国际科技合作项目的情况（限200字）</div>
<table id="tblMileStones3" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal3" style="width:98%; outline:none;resize:none;" class="input_textarea required  maxlength:200" label="承担的国家或安徽省国际科技合作项目的情况"   rows=5 cols=60><x:out select="$xmlData/data/project/goal3" /></textarea>
            <input type="hidden" name="project/goal3_hidden" id="project/goal3_hidden" value="<x:out select="$xmlData/data/project/goal3_hidden" />"/>
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>已取得的国际科技合作成果（限200字）</div>
<table id="tblMileStones4" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal4" style="width:98%; outline:none;resize:none;" class="input_textarea required  maxlength:200" label="已取得的国际科技合作成果"   rows=5 cols=60><x:out select="$xmlData/data/project/goal4" /></textarea>
            <input type="hidden" name="project/goal4_hidden" id="project/goal4_hidden" value="<x:out select="$xmlData/data/project/goal4_hidden" />"/>
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>简述在人才引进方面的主要工作（限200字）</div>
<table id="tblMileStones5" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal5" style="width:98%; outline:none;resize:none;" class="input_textarea required  maxlength:200" label="简述在人才引进方面的主要工作"   rows=5 cols=60><x:out select="$xmlData/data/project/goal5" /></textarea>
            <input type="hidden" name="project/goal5_hidden" id="project/goal5_hidden" value="<x:out select="$xmlData/data/project/goal5_hidden" />"/>
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>与国外签署的主要科技合作协议（限200字）</div>
<table id="tblMileStones6" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal6" style="width:98%; outline:none;resize:none;" class="input_textarea required  maxlength:200" label="与国外签署的主要科技合作协议"   rows=5 cols=60><x:out select="$xmlData/data/project/goal6" /></textarea>
            <input type="hidden" name="project/goal6_hidden" id="project/goal6_hidden" value="<x:out select="$xmlData/data/project/goal6_hidden" />"/>
        </td>
    </tr>
</table>
<table class="t_css table01" id="table_3" width="100%" border="0" cellpadding="0" id="basicInfo" cellspacing="1">
    <tr>
        <td align="right" width="20%"><span class="color_red">*</span>主要合作方式（可多选）：</td>
        <td colspan="3">
            <c:set var="cooperation"><x:out select="$xmlData/data/proposal/cooperation_value" /></c:set>
            <cpt:checkbox key="cooperation" name="cooperation"  value="${cooperation }" width="50px;" repeatColumn="4"></cpt:checkbox>
            <input type="hidden" id="cooperation_value" name="proposal/cooperation_value"  class="required"  value="<x:out select="$xmlData/data/proposal/cooperation_value" />" label="主要合作方式">
            <input type="hidden" name="proposal/cooperation_name" value="<x:out select="$xmlData/data/proposal/cooperation_name" />">
        </td>
    </tr>
</table>
<div class="t_bar"><span class="color_red">*</span>国外主要合作伙伴(最多5个) </div>
<table id="eq_table11" class="t_css table01" width="100%" >
    <thead >
    <tr style="border:1px solid ">
        <th class="TblHead" align="center"  width="5%">选择</th>
        <th class="TblHead" align="center"  width="5%">序号</th>
        <th class="TblHead" align="center"  width="30%">机构名称（中文）</th>
        <th class="TblHead" align="center"  width="30%">国别</th>
    </tr>
    </thead>
    <tbody>
    <tr style="display: none">
        <td align="center"><input type="radio" name="selMileStones" ></td>

        <td align="center"><span name="proposal|hatchs1|hatch[0]@seq_no">[index]</span></td>



        <td align="left"><input id="regist_date[0][0]" name="proposal|hatchs1|hatch[0]|partner_institution_name" class="input_text required"
                                onchange="setCooperationUnits();" style="width: 80%;" label="机构名称" maxlength="100" /></td>

        <td align="left"><input type="text" name="proposal|hatchs1|hatch[0]|partner_country" class="input_text required" maxlength="100"
                                style="width: 80%" label="国别" value=""/></td>

    </tr>

    <c:set value="0" var="index" scope="page" />
    <x:forEach select="$xmlData/data/proposal/hatchs1/hatch" var="list1">

        <c:choose>
            <c:when test="${index<10}" ><c:set value="0" var="flag" scope="page"/></c:when>
            <c:otherwise><c:set value="" var="flag" scope="page"/></c:otherwise>
        </c:choose>
        <tr>
            <td align="center"><input type="radio" class="radiobutton" name="selMileStones" style="border:0px;background-color:white"></td>
            <td align="center"><span name="proposal/hatchs1/hatch[${flag}${index}]@seq_no"><x:out select="$list1/@seq_no" /></span></td>


            <td align="left"><input type="text" name="proposal/hatchs1/hatch[${flag}${index}]/partner_institution_name" class="input_text required"
                                    onchange="setCooperationUnits();"  maxlength="100" style="width: 80%" label="机构名称" value="<x:out select="$list1/partner_institution_name" />"/></td>

            <td align="left"><input type="text" name="proposal/hatchs1/hatch[${flag}${index}]/partner_country" class="input_text required"
                                    maxlength="100"  style="width: 80%" label="国别" value="<x:out select="$list1/partner_country" />"/></td>
        </tr>
        <c:set value="${index+1}" var="index" scope="page" />
    </x:forEach>
    </tbody>
</table>

<table width="98%" align="center">
    <tr>
        <td><input class="button_02" name="cmdAddbefore"type=button value="添加" onclick="if(checkTabLimit('eq_table11',5,'国外主要合作伙伴最多只能填写5条记录')){addNewRow('eq_table11');showDateTag('eq_table11');}try{top.resizeFrame();}catch(e){};setCooperationUnits();">
            <input class="button_02" name="cmdMovePrev" type=button value="上移" onclick="movePrev('eq_table11','selMileStones');setCooperationUnits();">
            <input class="button_02" name="cmdMoveNext" type=button value="下移" onclick="moveNext('eq_table11','selMileStones');setCooperationUnits();">
            <input class="button_02" name="cmddel" type=button value="删除" onclick="deleteSelectedRow('eq_table11','国外主要合作伙伴');setCooperationUnits();">
        </td>
    </tr>
</table>
<input type="hidden" name="proposal/cooperation_units" id="cooperation_units" value="<x:out select='$xmlData/data/proposal/cooperation_units'/>"/>
<div class="t_bar"><span class="color_red">*</span>国外合作伙伴的技术特点、优势及投入（限200字）</div>
<table id="tblMileStones7" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal7" style="width:98%; outline:none;resize:none;" class="input_textarea required  maxlength:200" label="国外合作伙伴的技术特点、优势及投入"   rows=5 cols=60><x:out select="$xmlData/data/project/goal7" /></textarea>
            <input type="hidden" name="project/goal7_hidden" id="project/goal7_hidden" value="<x:out select="$xmlData/data/project/goal7_hidden" />"/>
        </td>
    </tr>
</table>

<div class="t_bar"><span class="color_red">*</span>简述在国际科技合作方面对本领域和地区的引领和示范作用（限200字）</div>
<table id="tblMileStones8" cellpadding="0" class="table01 t_css" width="100%" border="0" cellpadding="0" style="*border-bottom: #a1c0dc 1px solid;">
    <col style="width:34%"/>
    <col style="width:40%"/>
    <col style="width:13%"/>
    <col style="width:13%"/>
    <tr>
        <td colspan="4">
            <textarea name="project/goal8" style="width:98%; outline:none;resize:none;" class="input_textarea required  maxlength:200" label="简述在国际科技合作方面对本领域和地区的引领和示范作用"   rows=5 cols=60><x:out select="$xmlData/data/project/goal8" /></textarea>
            <input type="hidden" name="project/goal8_hidden" id="project/goal8_hidden" value="<x:out select="$xmlData/data/project/goal8_hidden" />"/>
        </td>
    </tr>
</table>
<script type="text/javascript">
    function setCooperationUnits(){
        var cooperation_units="";
        $("#eq_table11 tr:gt(1)").each(function(index){
            var cooperation_unit = $(this).find("td:eq(2) input").val().trim();
            var orgName = $("#org_name").val().trim();
            if(!isBlankOrNull(cooperation_unit) && cooperation_unit!=orgName){
                cooperation_units += cooperation_unit+",";
            }
        });
        if(cooperation_units!=""){
            cooperation_units=cooperation_units.substring(0,cooperation_units.length-1);
        }
        $("#cooperation_units").val(cooperation_units);
    }
    function isBlankOrNull(str){
        if(str.trim()==""){
            return true;
        }else if(str){
            return false;
        }else{
            return true;
        }
    }
function initTreeValueExt(treeId, treeNode) {
 	if ((treeNode && treeNode.isParent)) {
 		scmWarn("请选择具体的" + $("#" + treeId).attr("label"));
 		$("#" + treeId).val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId	+ "_value']").val("");
 		$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val("");
 		return false;
 	}
 	var str = treeNode.name;
 	var obj = treeNode.parentNode;
 	while (obj != null) {
 		str = obj.name + "-" + str;
 		obj = obj.parentNode;
 	}
 	
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_code'],[id$='" + treeId + "_code']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_value'],[id$='" + treeId + "_value']").val(treeNode.id);
 	$("#" + treeId).parents("td").find("[name$='" + treeId + "_name'],[id$='" + treeId + "_name']").val(str);
}
</script>	